<?php if($index == 0):?>
    <div class="row row-post">
        <div class="col-img">
           <abbr rel="tooltip" title="Ảnh đại diện"><i class="fa fa-picture-o"></i> Ảnh</abbr>
        </div>
        <div class="col-title">
            <abbr rel="tooltip" title="Tiêu đề bài viết"><i class="fa fa-text-width"></i> Tiêu đề</abbr>
        </div>
        <div class="col-view hidden-xs text-center">
            <abbr rel="tooltip" title="Trả lời"><i class="fa fa-reply"></i></abbr>/<abbr rel="tooltip" title="Lượt xem"><i class="fa fa-eye"></i></abbr>
        </div>
        <div class="col-reply hidden-xs">
            <abbr rel="tooltip" title="Trả lời mới"><i class="fa fa-reply-all"></i> Trả lời</abbr> 
        </div>
    </div>
    <hr class="margintop0 marginbottom0"/>
<?php endif?>         

<div class="row row-post <?php if($index%2==0):?>odd<?php endif?>">
    <div class="col-img">
        <img class="thumbnail marginbottom0" src="<?php echo Post::model()->getImagePathDetect('100', $data['id'], $data['image'], $data['user']['id']);?>" />
    </div>
    <div class="col-title" rel="popover" data-placement="auto" data-trigger="hover" data-content="<?php echo CHtml::encode($data['desc'])?>">
        <?php if($data['price']):?>
        <span class="label label-danger pull-right"><?php echo Post::model()->getPriceLabel($data['price'])?></span>
        <?php endif?>
                    
        <a href="<?php echo Post::model()->getUrl('view', $data['id'], $data['title_unsigned']);?>" title="<?php echo CHtml::encode($data['title'])?>">
            <?php echo $data['title'];?>
        </a>

        <div>
            <span class="label label-success"><?php echo $data['city_alias'] ? $this->cities[$data['city_alias']]['name'] : 'Toàn quốc'?></span>
            <span class="label label-warning"><?php echo $data['user']['name']?></span>
            <?php if($data['show_map']):?>
            <abbr class="initialism" rel="tooltip" title="Có bản đồ">
                <i class="fa fa-map-marker fa-border"></i>
            </abbr>  
            <?php endif?>
            <?php if($data['has_image']):?>
            <abbr class="initialism" rel="tooltip" title="Có <?php echo $data['image_count']?> ảnh">
                <i class="fa fa-picture-o fa-border"></i>
            </abbr>  
            <?php endif?>
            <?php if($data['is_all_city']):?>
            <abbr class="initialism" rel="tooltip" title="Rao bán toàn quốc">
                <i class="fa fa-globe fa-border"></i>
            </abbr>
            <?php endif?>
            <span class="text-mini text-muted"><?php echo MyDateTime::relative($data['created'])?></span>

        </div>
    </div>
    <div class="col-view hidden-xs text-center">
        <abbr rel="tooltip" title="<?php echo $data['reply_count']?> trả lời"><?php echo $data['reply_count']?></abbr>
        <br /> 
        <abbr rel="tooltip" title="<?php echo $data['view_count']?> lượt xem"><?php echo $data['view_count']?></abbr>
    </div>
    <?php if($data['reply_last']['id']):?>
    <div class="col-reply hidden-xs" rel="popover" data-placement="auto" data-trigger="hover" title="<?php echo $data['reply_last']['user']['name']?> trả lời" data-content="<?php echo $data['reply_last']['desc']?>">
        <div class="label label-warning"><?php echo $data['reply_last']['user']['name']?></div>
        <div class="text-mini text-muted"><?php echo MyDateTime::relative($data['reply_last']['created'])?></div>
    </div>
    <?php endif?>
</div>
<hr class="marginbottom0 margintop0" />